package com.vincent.dao;

import com.vincent.common.enums.CacheEnum;
import com.vincent.model.Ad;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * Created by vincent on 15-1-2.
 */
@Repository("adDao")
public class AdDao {
    @Resource
    private AdMapper adMapper;
    @Cacheable(value = CacheEnum.AD)
    public List<Ad> selectAll(){
        return adMapper.selectAll(new Date());
    }
    @CacheEvict(value = CacheEnum.AD,allEntries = true)
    public void clearCache(){

    }

}